﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ZNGLForm.aspx.cs" Inherits="RenShiKaoQin.Account.ZNGLForm" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager" runat="server" EnableScriptGlobalization="true"
        EnableScriptLocalization="true">
</ajaxToolkit:ToolkitScriptManager>
<div align="center" style="margin-left: 40px">
    输入姓名<asp:TextBox ID="tbName" runat="server"></asp:TextBox><asp:Button ID="btnSearch"
        runat="server" Text="查找" />
    <asp:GridView ID="gvPeople" runat="server" AutoGenerateColumns="False" 
        CellPadding="4" DataKeyNames="FEmployeeID" DataSourceID="sqlPeople" 
        Font-Size="17px" ForeColor="#333333" GridLines="None" 
        onrowcommand="gvPeople_RowCommand" EmptyDataText="没有符合条件的数据">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:BoundField DataField="FName" HeaderText="姓名" SortExpression="FName" />
            <asp:BoundField DataField="DeptName" HeaderText="所在科室" 
                SortExpression="DeptName" />
            <asp:TemplateField HeaderText="选择">
                <ItemTemplate>
                    <asp:LinkButton ID="lkbFH" runat="server" CommandName="SelectPeople" Text="选择" CommandArgument='<%# DataBinder.Eval(Container, "RowIndex") %>'></asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="FEmployeeID" HeaderText="FEmployeeID" 
                ReadOnly="True" SortExpression="FEmployeeID" Visible="False" />
            <asp:BoundField DataField="FDeptCode" HeaderText="FDeptCode" 
                SortExpression="FDeptCode" Visible="False" />
        </Columns>
        <EditRowStyle BackColor="#2461BF" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#EFF3FB" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F5F7FB" />
        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
        <SortedDescendingCellStyle BackColor="#E9EBEF" />
        <SortedDescendingHeaderStyle BackColor="#4870BE" />
    </asp:GridView>
    <asp:HiddenField ID="hfID" runat="server" /><asp:HiddenField ID="hfDept" runat="server" />
    <asp:SqlDataSource ID="sqlPeople" runat="server" 
        ConnectionString="<%$ ConnectionStrings:hrdbConnectionString %>" 
        
        SelectCommand="SELECT TEmployee.FEmployeeID, TEmployee.FName, TEmployee.FOldName, TEmployee.FGenderCode, TEmployee.FNationCode, TEmployee.FBirthday, TEmployee.FCardID, TEmployee.FPublicID, TDictDept.FName AS DeptName, TDept.FDeptCode FROM TEmployee INNER JOIN TDept ON TEmployee.FEmployeeID = TDept.FEmployeeID INNER JOIN TDictDept ON TDept.FDeptCode = TDictDept.FDeptCode WHERE (TEmployee.FName = @EmployeeName) AND (TDept.FValidDate = (SELECT MAX(FValidDate) AS Expr1 FROM TDept AS TDept_1 WHERE (FEmployeeID = TEmployee.FEmployeeID)))">
        <SelectParameters>
            <asp:ControlParameter ControlID="tbName" Name="EmployeeName" 
                PropertyName="Text" />
        </SelectParameters>
    </asp:SqlDataSource>
    <div id="lkbHuiZhenPanel" style="border:2px solid black;width:450px;font-size:20px;font-weight:bold;height:35px;vertical-align:middle;line-height:35px;cursor:pointer">录入会诊信息&nbsp;&nbsp;<asp:Label ID="lbHuiZhen" runat="server"></asp:Label></div>
    <asp:Panel ID="panelHuiZhen" runat="server">
    <table cellpadding="3" cellspacing="0" width="650px">
    <tr><td>姓名</td><td><asp:Label ID="lbName" runat="server" /></td><td>所在科室</td><td><asp:Label ID="lbDept" runat="server" /></td></tr>
    <tr><td>会诊日期</td><td><asp:TextBox ID="tbStartDate" runat="server" Width="100%" /><ajaxToolkit:CalendarExtender ID="caltbStart" TargetControlID="tbStartDate" runat="server" Format="yyyy-MM-dd" DefaultView="Months"></ajaxToolkit:CalendarExtender></td><td>
        经手人</td><td>
        <asp:TextBox ID="tbDutyPerson" runat="server" Width="100%" /></td></tr>
    <tr><td>会诊目的</td><td><asp:DropDownList ID="ddlType" runat="server" 
            DataSourceID="sqlKQType" DataTextField="FName" 
            DataValueField="FKQTypeCode" Width="100%"></asp:DropDownList>
        <asp:SqlDataSource ID="sqlKQType" runat="server" 
            ConnectionString="<%$ ConnectionStrings:hrdbConnectionString %>" 
            
            SelectCommand="SELECT FKQTypeCode, FName FROM TDictKQType WHERE (FKQTypeCode LIKE '18%') AND (LEN(FKQTypeCode) &gt; 2)">
        </asp:SqlDataSource>
        </td><td>会诊医院</td><td><asp:TextBox ID="tbMemo" runat="server" Width="100%"></asp:TextBox></td></tr>
        <tr><td>是否点名</td><td>
            <asp:CheckBox ID="cbDianMing" runat="server" Checked="True" /></td><td>是否联系</td><td>
                <asp:CheckBox ID="cbLianXi" runat="server" Checked="True" /></td></tr>
        <tr><td>是否通知</td><td>
            <asp:CheckBox ID="cbTongZhi" runat="server" Checked="True" /></td><td>备注</td><td>
                <asp:TextBox ID="tbBeiZhu" runat="server" EnableViewState="False" Width="100%"></asp:TextBox>
            </td></tr>
        <tr><td colspan="4"><asp:Button ID="btnSubmit" runat="server" Text="提交会诊记录" 
                BorderStyle="None" onclick="btnSubmit_Click" Width="100%" /></td></tr>
    </table>
    <asp:GridView ID="gvApplication" runat="server" AllowPaging="True" 
        AutoGenerateColumns="False" CellPadding="4" DataKeyNames="SerialNO" 
        DataSourceID="sqlApplication" ForeColor="#333333" GridLines="None" 
        Font-Size="15px">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:BoundField DataField="EmployeeName" HeaderText="姓名" 
                SortExpression="EmployeeName" />
            <asp:BoundField DataField="DeptName" HeaderText="所在科室" 
                SortExpression="DeptName" />
            <asp:BoundField DataField="StartDate" DataFormatString="{0:yyyy-MM-dd}" 
                HeaderText="会诊时间" SortExpression="StartDate" />
            <asp:BoundField DataField="KQType" 
                HeaderText="会诊目的" SortExpression="KQType" />
            <asp:BoundField DataField="Memo" HeaderText="会诊医院" SortExpression="Memo" />
            <asp:BoundField DataField="DutyPerson" HeaderText="经手人" 
                SortExpression="DutyPerson" />
            <asp:BoundField DataField="ConMemo" HeaderText="备注" SortExpression="ConMemo" />
            <asp:CommandField ShowDeleteButton="True" DeleteText="删除" />
        </Columns>
        <EditRowStyle BackColor="#2461BF" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#EFF3FB" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F5F7FB" />
        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
        <SortedDescendingCellStyle BackColor="#E9EBEF" />
        <SortedDescendingHeaderStyle BackColor="#4870BE" />
    </asp:GridView>
    <asp:SqlDataSource ID="sqlApplication" runat="server" 
        ConnectionString="<%$ ConnectionStrings:hrdbConnectionString %>" 
        SelectCommand="SELECT TKQRequestRecord.FEmployeeID, TKQRequestRecord.StartDate, TKQRequestRecord.EndDate, TKQRequestRecord.TypeCode, TKQRequestRecord.Memo, TKQRequestRecord.ExamStatus, TKQRequestRecord.CheckStatus, TKQRequestRecord.SerialNO, TKQRequestRecord.ReadStatus, TKQRequestRecord.DeptCode, TKQRequestRecord.CheckerID, TKQRequestRecord.ExamerID, TKQRequestRecord.CheckDate, TKQRequestRecord.ExamDate, TDictKQType.FName AS KQType, TDictDept.FName AS DeptName, TEmployee.FName AS EmployeeName, TKQConsultationRecord.IsDianMing, TKQConsultationRecord.IsLianXi, TKQConsultationRecord.IsTongZhi, TKQConsultationRecord.DutyPerson, TKQConsultationRecord.Memo AS ConMemo FROM TKQRequestRecord INNER JOIN TDictKQType ON TKQRequestRecord.TypeCode = TDictKQType.FKQTypeCode INNER JOIN TDept ON TKQRequestRecord.FEmployeeID = TDept.FEmployeeID INNER JOIN TDictDept ON TDept.FDeptCode = TDictDept.FDeptCode INNER JOIN TEmployee ON TEmployee.FEmployeeID = TKQRequestRecord.FEmployeeID INNER JOIN TKQConsultationRecord ON TKQRequestRecord.SerialNO = TKQConsultationRecord.SerialNO WHERE (TDictKQType.FKQTypeCode LIKE '18%') AND (LEN(TDictKQType.FKQTypeCode) &gt; 2) AND (TDept.FValidDate = (SELECT MAX(FValidDate) AS Expr1 FROM TDept AS TDept_1 WHERE (FEmployeeID = TKQRequestRecord.FEmployeeID))) ORDER BY TKQRequestRecord.StartDate DESC, EmployeeName, DeptName" 
        DeleteCommand="DELETE FROM TKQRequestRecord WHERE (SerialNO = @SerialNO)">
        <DeleteParameters>
            <asp:Parameter Name="SerialNO" />
        </DeleteParameters>
    </asp:SqlDataSource>
    </asp:Panel>
    <ajaxToolkit:CollapsiblePanelExtender runat="server" CollapsedText="（点击展开...）" ID="cpeHuiZhen"
        TargetControlID="panelHuiZhen" CollapseControlID="lkbHuiZhenPanel" 
        ExpandControlID="lkbHuiZhenPanel" TextLabelID="lbHuiZhen" ExpandedText="（点击收起...）"></ajaxToolkit:CollapsiblePanelExtender>
     <div id="divZhiNong" style="border:2px solid black;width:450px;font-size:20px;font-weight:bold;height:35px;vertical-align:middle;line-height:35px;cursor:pointer;">录入卫生强基信息&nbsp;&nbsp;<asp:Label ID="lbZhiNong" runat="server"></asp:Label></div>
    <asp:Panel ID="panelZhiNong" runat="server">
        <table cellpadding="3" cellspacing="0" width="650px">
    <tr><td>姓名</td><td><asp:Label ID="lbName2" runat="server" /></td><td>所在科室</td><td><asp:Label ID="lbDept2" runat="server" /></td></tr><tr><td>开始时间</td><td><asp:TextBox ID="tbStartDate2" runat="server" Width="100%" /><ajaxToolkit:CalendarExtender ID="CalendarExtender1" TargetControlID="tbStartDate2" runat="server" Format="yyyy-MM-dd" DefaultView="Months"></ajaxToolkit:CalendarExtender></td><td>结束时间</td><td><asp:TextBox ID="tbEndDate2" runat="server" Width="100%" /><ajaxToolkit:CalendarExtender ID="CalendarExtender2" TargetControlID="tbEndDate2" runat="server" Format="yyyy-MM-dd" DefaultView="Months"></ajaxToolkit:CalendarExtender></td></tr>
    <tr><td>强基地点</td><td><asp:TextBox ID="tbqjLocation" runat="server" Width="100%"></asp:TextBox></td><td colspan="2"><asp:Button ID="btnApplyZhiNong" 
            runat="server" Text="提交卫生强基记录" BorderStyle="None" 
            onclick="btnApplyZhiNong_Click" Width="100%" /></td></tr></table>
    <asp:GridView ID="gvQJ" runat="server" AutoGenerateColumns="False" 
        CellPadding="4" DataKeyNames="SerialNO" DataSourceID="sqlQJ" 
        ForeColor="#333333" GridLines="None" Font-Size="15px" AllowPaging="True">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:BoundField DataField="EmployeeName" HeaderText="姓名" 
                SortExpression="EmployeeName" />
            <asp:BoundField DataField="DeptName" HeaderText="所在科室" 
                SortExpression="DeptName" />
            <asp:BoundField DataField="StartDate" HeaderText="开始时间" 
                SortExpression="StartDate" DataFormatString="{0:yyyy-MM-dd}" />
            <asp:BoundField DataField="EndDate" HeaderText="结束时间" 
                SortExpression="EndDate" DataFormatString="{0:yyyy-MM-dd}" />
            <asp:BoundField DataField="Memo" HeaderText="强基地点" 
                SortExpression="Memo" />
            <asp:CommandField ShowDeleteButton="True" DeleteText="删除" />
        </Columns>
        <EditRowStyle BackColor="#2461BF" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#EFF3FB" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F5F7FB" />
        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
        <SortedDescendingCellStyle BackColor="#E9EBEF" />
        <SortedDescendingHeaderStyle BackColor="#4870BE" />
    </asp:GridView>          
    <asp:SqlDataSource ID="sqlQJ" runat="server" 
        ConnectionString="<%$ ConnectionStrings:hrdbConnectionString %>" 
        
        SelectCommand="SELECT TKQRequestRecord.FEmployeeID, TKQRequestRecord.StartDate, TKQRequestRecord.EndDate, TKQRequestRecord.TypeCode, TKQRequestRecord.Memo, TKQRequestRecord.ExamStatus, TKQRequestRecord.CheckStatus, TKQRequestRecord.SerialNO, TKQRequestRecord.ReadStatus, TKQRequestRecord.DeptCode, TKQRequestRecord.CheckerID, TKQRequestRecord.ExamerID, TKQRequestRecord.CheckDate, TKQRequestRecord.ExamDate, TKQRequestRecord.RejectStatus, TKQRequestRecord.RejectReason, TEmployee.FName AS EmployeeName, TDictDept.FName AS DeptName FROM TKQRequestRecord INNER JOIN TEmployee ON TKQRequestRecord.FEmployeeID = TEmployee.FEmployeeID INNER JOIN TDictDept ON TKQRequestRecord.DeptCode = TDictDept.FDeptCode WHERE (TKQRequestRecord.TypeCode = '1901') ORDER BY EmployeeName, DeptName" 
        DeleteCommand="DELETE FROM TKQRequestRecord WHERE (SerialNO = @SerialNO)">
        <DeleteParameters>
            <asp:Parameter Name="SerialNO" />
        </DeleteParameters>
    </asp:SqlDataSource>
    </asp:Panel>
    <ajaxToolkit:CollapsiblePanelExtender runat="server" CollapsedText="（点击展开...）" ID="cpeZhiNong"
        TargetControlID="panelZhiNong" CollapseControlID="divZhiNong" 
        ExpandControlID="divZhiNong" TextLabelID="lbZhiNong" ExpandedText="（点击收起...）"></ajaxToolkit:CollapsiblePanelExtender>
</div>
</asp:Content>
